package com.bai.Utils;

import com.bai.Constant.ResultConst;
import com.bai.dto.PublicResponseBody;

public class DtoResultUtil {
    public  static PublicResponseBody resultSuccess(){
        PublicResponseBody publicResponseBody=new PublicResponseBody();
        publicResponseBody.setMessage(ResultConst.success);
        publicResponseBody.setCode(1);
        return publicResponseBody;
    }
    public  static PublicResponseBody resultSuccess(Object object){
        PublicResponseBody publicResponseBody=new PublicResponseBody();
        publicResponseBody.setMessage(ResultConst.success);
        publicResponseBody.setData(object);
        publicResponseBody.setCode(1);
        return publicResponseBody;
    }
    public  static PublicResponseBody result(int code,String result){
        PublicResponseBody publicResponseBody=new PublicResponseBody();
        publicResponseBody.setCode(code);
        publicResponseBody.setMessage(result);
        return publicResponseBody;
    }
    public  static PublicResponseBody resultError(){
        PublicResponseBody publicResponseBody=new PublicResponseBody();
        publicResponseBody.setMessage(ResultConst.error);
        publicResponseBody.setCode(-3);
        return publicResponseBody;
    }
    public  static PublicResponseBody resultParamError(){
        PublicResponseBody publicResponseBody=new PublicResponseBody();
        publicResponseBody.setMessage(ResultConst.param_error);
        publicResponseBody.setCode(-2);
        return publicResponseBody;
    }
}
